package cn.cs.client;

import cn.cs.pojo.CsUser;

import cn.cs.fallback.CsUserClientFallBack;

import java.util.List;
import java.util.Map;

import cn.cs.config.CsConfiguration;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * Created by yuexl
 */
@FeignClient(name = "cs-user-provider", configuration = CsConfiguration.class, fallback = CsUserClientFallBack.class)
public interface RestCsUserClient {
    @RequestMapping(value = "/checkLoginByPassword", method = RequestMethod.POST)
    public CsUser checkLoginByPassword(@RequestBody CsUser csUser) throws Exception;

    @RequestMapping(value = "/getCsUserById", method = RequestMethod.POST)
    public CsUser getCsUserById(@RequestParam("id") Long id) throws Exception;

    @RequestMapping(value = "/getCsUserListByMap", method = RequestMethod.POST)
    public List<CsUser> getCsUserListByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/getCsUserCountByMap", method = RequestMethod.POST)
    public Integer getCsUserCountByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/qdtxAddCsUser", method = RequestMethod.POST)
    public Integer qdtxAddCsUser(@RequestBody CsUser csUser) throws Exception;

    @RequestMapping(value = "/qdtxModifyCsUser", method = RequestMethod.POST)
    public Integer qdtxModifyCsUser(@RequestBody CsUser csUser) throws Exception;

    @RequestMapping(value = "/findByWxUserId", method = RequestMethod.POST)
    public CsUser findByWxUserId(@RequestParam("wxUserId") String wxUserId) throws Exception;

    @RequestMapping(value = "/createCsUser", method = RequestMethod.POST)
    public Long createCsUser(@RequestBody CsUser csUser) throws Exception;

    @RequestMapping(value = "/generateToken", method = RequestMethod.POST)
    public String generateToken(@RequestBody CsUser csUser) throws Exception;
}

